package cc.rengu.igas.bomp.common.enums;

/**
 * Created by zhangxuran on 2020/04/22
 */
public enum SettleAcctTypeEnum {
    SELF_DEBIT("00", "本行借记账户"),
    SELF_CREDIT("01", "本行贷记账户"),
    SELFT_PASSBOOK("02", "本行存折"),
    SELF_INTERNAL("03", "本行内部户"),
    SELF_PUBLIC("04", "本行对公户"),
    OTHER_DEBIT("10", "他行借记账户"),
    OTHER_CREDIT("11", "他行贷记账户"),
    OTHER_PASSBOOK("12", "他行存折"),
    OTHER_INTERNAL("13", "他行内部户"),
    OTHER_PUBLIC("14", "他行对公户"),
    ;
    private String acctType;
    private String acctDesc;

    SettleAcctTypeEnum(String acctType, String acctDesc) {
        this.acctType = acctType;
        this.acctDesc = acctDesc;
    }

    public String getAcctType() {
        return acctType;
    }

    public void setAcctType(String acctType) {
        this.acctType = acctType;
    }

    public String getAcctDesc() {
        return acctDesc;
    }

    public void setAcctDesc(String acctDesc) {
        this.acctDesc = acctDesc;
    }

    /*
     * 根据账户类型编码查询账户类型
     * acctType 账户类型编码
     * return acctDesc  账户类型描述
     * */
    public static String getAcctDescByacctType(String acctType) {
        for (SettleAcctTypeEnum settleAcctTypeEnum : SettleAcctTypeEnum.values()) {
            if (settleAcctTypeEnum.getAcctType().equals(acctType)) {
                return settleAcctTypeEnum.getAcctDesc();
            }
        }
        return null;
    }
}
